<? $secName=intval($_GET['secName']);
$link = mysql_connect('localhost', 'root', ''); //changet the configuration in required
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
mysql_select_db('elearning');
$query="SELECT u.userid, s.sectionid, u.fname,u.lname,u.mname,s.roomName,s.sectionName
	    FROM tbluser u INNER JOIN tblsection s ON s.sectionAdviser = u.userid
	    WHERE s.studentName = 'none' AND s.sectionid = '$secName' ";
$result=mysql_query($query);

?>
<select name="roomName" onchange="getSecAd(<?=$secName?>,this.value)">
<option>Select Room Name</option>
<? while($row=mysql_fetch_array($result)) { ?>
<option value=<?=$row['roomName']?>><?=$row['roomName']?></option>

 <? } ?>
</select>